package com.design02_Structural.pattern09_adapter.example02;

import com.design02_Structural.pattern09_adapter.example01.SDCard;
import com.design02_Structural.pattern09_adapter.example01.TFCard;

/**
 * @ClassName SDAdapterTF
 * @Description 对象适配器模式
 * @Author zhangjunhao
 * @DATE 2023/9/5 21:59
 */
public class SDAdapterTF implements SDCard {

    private TFCard tFCard;

    public SDAdapterTF(TFCard tFCard) {
        this.tFCard = tFCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter read tf card ");
        return tFCard.readTF();
    }
    @Override
    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tFCard.writeTF(msg);
    }

}
